﻿using System;
using System.Collections.Specialized;
using System.IO;
using System.Web;

namespace NWebMock
{
    public class HttpServerUtilityWrapper : IHttpServerUtility
    {
        #region Constructors

        public HttpServerUtilityWrapper(HttpServerUtility server)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }

            this.innerServer = server;
        }

        #endregion

        #region Fields

        private HttpServerUtility innerServer = null;

        #endregion

        #region Properties

        public string MachineName { get { return this.innerServer.MachineName; } }

        public int ScriptTimeout { get { return this.innerServer.ScriptTimeout; } set { this.innerServer.ScriptTimeout = value; } }

        #endregion

        #region Methods

        public void ClearError()
        {
            this.innerServer.ClearError();
        }

        public object CreateObject(string progID)
        {
            return this.innerServer.CreateObject(progID);
        }

        public object CreateObject(Type type)
        {
            return this.innerServer.CreateObject(type);
        }

        public object CreateObjectFromClsid(string clsid)
        {
            return this.innerServer.CreateObjectFromClsid(clsid);
        }

        public void Execute(string path)
        {
            this.innerServer.Execute(path);
        }

        public void Execute(string path, bool preserveForm)
        {
            this.innerServer.Execute(path, preserveForm);
        }

        public void Execute(string path, TextWriter writer)
        {
            this.innerServer.Execute(path, writer);
        }

        public void Execute(IHttpHandler handler, TextWriter writer, bool preserveForm)
        {
            this.innerServer.Execute(handler, writer, preserveForm);
        }

        public void Execute(string path, TextWriter writer, bool preserveForm)
        {
            this.innerServer.Execute(path, writer, preserveForm);
        }

        public Exception GetLastError()
        {
            return this.innerServer.GetLastError();
        }

        public string HtmlDecode(string s)
        {
            return this.innerServer.HtmlDecode(s);
        }

        public void HtmlDecode(string s, TextWriter output)
        {
            this.innerServer.HtmlDecode(s, output);
        }

        public string HtmlEncode(string s)
        {
            return this.innerServer.HtmlEncode(s);
        }

        public void HtmlEncode(string s, TextWriter output)
        {
            this.innerServer.HtmlEncode(s, output);
        }

        public string MapPath(string path)
        {
            return this.innerServer.MapPath(path);
        }

        public void Transfer(string path)
        {
            this.innerServer.Transfer(path);
        }

        public void Transfer(IHttpHandler handler, bool preserveForm)
        {
            this.innerServer.Transfer(handler, preserveForm);
        }

        public void Transfer(string path, bool preserveForm)
        {
            this.innerServer.Transfer(path, preserveForm);
        }

        public void TransferRequest(string path)
        {
            this.innerServer.TransferRequest(path);
        }

        public void TransferRequest(string path, bool preserveForm)
        {
            this.innerServer.TransferRequest(path, preserveForm);
        }

        public void TransferRequest(string path, bool preserveForm, string method, NameValueCollection headers)
        {
            this.innerServer.TransferRequest(path, preserveForm, method, headers);
        }

        public string UrlDecode(string s)
        {
            return this.innerServer.UrlDecode(s);
        }

        public void UrlDecode(string s, TextWriter output)
        {
            this.innerServer.UrlDecode(s, output);
        }

        public string UrlEncode(string s)
        {
            return this.innerServer.UrlEncode(s);
        }

        public void UrlEncode(string s, TextWriter output)
        {
            this.innerServer.UrlEncode(s, output);
        }

        public string UrlPathEncode(string s)
        {
            return this.innerServer.UrlPathEncode(s);
        }

        #endregion
    }
}
